#ifndef UTIL_CONFIG_H_
#define UTIL_CONFIG_H_

#pragma warning(disable:4819)
#include <string>
#include <vector>

#include "zlbase/zlbase.h"

const std::string ZLBaseConfigFile = "c:\\zhilai\\zlbase.config";

class CZlBaseConfig
{
public:
    struct ZLBaseDevice
    {
        int32_t number;                       //< 板号
        int32_t count;                        //< 格口数量
        zl::zlbase::EDeviceType type;         //< 控制板类型
        std::string uuid;                     //< 控制板协议UUID
        zl::zlbase::DatalinkOption datalink;  //< 控制板链路选项
    };

    CZlBaseConfig() = default;
    ~CZlBaseConfig() = default;

    bool Load(const std::string& path = ZLBaseConfigFile);

    bool Save(const std::string& path = ZLBaseConfigFile);

    std::vector<ZLBaseDevice>& GetDevice() { return devices_; }

private:
    std::vector<ZLBaseDevice> devices_;
};

#endif  // UTIL_CONFIG_H_